package com.bt.lms.ui.action.school_education.query_details;

import com.bt.lms.ui.page.school_education.query_details.PageCheckManage;
import com.bt.lms.ui.page.school_education.query_details.PageCheckStudentStatus;
import javafx.collections.ObservableList;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;

/**
 * 学籍档案信息按钮事件
 */
public class QueryStudentStatusAction implements EventHandler {

    private PageCheckManage pageCheckManage;

    public QueryStudentStatusAction(PageCheckManage pageCheckManage) {
        this.pageCheckManage = pageCheckManage;
    }

    @Override
    public void handle(Event event) {

        //获取里边有几个盒子
        ObservableList<Node> children = pageCheckManage.getChildren();

        HBox hBox = (HBox) children.get(0);
        ObservableList<Node> hBoxChildren = hBox.getChildren();
        hBoxChildren.remove(3);
        Label label = new Label("学籍档案信息");
        hBoxChildren.add(label);

        //调用方法，创建一个新的加进去
        PageCheckStudentStatus pageCheckStudentStatus = new PageCheckStudentStatus(pageCheckManage);
        children.set(2, pageCheckStudentStatus);

    }
}
